Skip to content

add element replace parser for cp2k output and refactor the unittest for cp2k output#234

Merged
wanghan-iapcm merged 2 commits into
deepmodeling:develfrom
robinzyb:devel
Dec 10, 2021
Merged

add element replace parser for cp2k output and refactor the unittest for cp2k output#234
wanghan-iapcm merged 2 commits into
deepmodeling:develfrom
robinzyb:devel

Conversation

@robinzyb

@robinzyb robinzyb commented Dec 9, 2021

Copy link
Copy Markdown
Collaborator

cp2k can replace atomic symbol to fine tune the atomic state when labeling.

For example: Fe in Fe2O3 has two states where one has 5 d alpha electron and the other one has 5 d beta electron.
In cp2k input KIND SECTION, KIND symbols can be replaced with Fe1 and Fe2, meanwhile the ELEMENT keyword is set to Fe, such as

  &KIND Fe1   
    ELEMENT Fe
 &END KIND
  &KIND Fe2   
    ELEMENT Fe
 &END KIND

And the output for coordinate is

 Atom  Kind  Element       X           Y           Z          Z(eff)       Mass
 
        1     1 Fe  26    0.000000    0.000000    1.992808     16.00      55.8450
        2     2 Fe  26    0.000000    0.000000    8.878808     16.00      55.8450
        3     1 Fe  26    0.000000    0.000000   11.779192     16.00      55.8450
        4     2 Fe  26    0.000000    0.000000    4.893192     16.00      55.8450
        5     1 Fe  26    2.519000    1.454345    6.583475     16.00      55.8450
        6     2 Fe  26    2.519000    1.454345   13.469475     16.00      55.8450
        7     1 Fe  26    2.519000    1.454345    2.597858     16.00      55.8450
        8     2 Fe  26    2.519000    1.454345    9.483858     16.00      55.8450
        9     1 Fe  26    0.000000    2.908691   11.174142     16.00      55.8450
       10     2 Fe  26    0.000000    2.908691    4.288142     16.00      55.8450
       11     1 Fe  26    0.000000    2.908691    7.188525     16.00      55.8450
       12     2 Fe  26    0.000000    2.908691    0.302525     16.00      55.8450
       13     3 O    8    1.541124    0.000000    3.443000      6.00      15.9994

it is obvious that parsing element symbol can't distinguish the two types of 'Fe'
Now, I parse the

 1. Atomic kind: Fe1  
 2. Atomic kind: Fe2 
 3. Atomic kind: O

first, in cp2k output
then replace the element Kind with the symbols in coordinate block.

@codecov-commenter

codecov-commenter commented Dec 9, 2021

Copy link
Copy Markdown

Codecov Report

Merging #234 (2b58bcb) into devel (a2d13e6) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #234      +/-   ##
==========================================
+ Coverage   82.04%   82.09%   +0.05%     
==========================================
  Files          58       58              
  Lines        5034     5043       +9     
==========================================
+ Hits         4130     4140      +10     
+ Misses        904      903       -1     
Impacted Files Coverage Δ
dpdata/cp2k/output.py 98.15% <100.00%> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d0cb75...2b58bcb. Read the comment docs.

@wanghan-iapcm wanghan-iapcm merged commit 6d62862 into deepmodeling:devel Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants